import request from '@/utils/request'
/**
 * 获取分类列表
 */
export function getcategotyList(params) {
  return request({
    url: '/categories',
    method: 'get',
    params
  })
}

/**
 * 删除分类
 */
export function delCategoty(id) {
  return request({
    url: `/categories/${id}`,
    method: 'delete'
  })
}

/**
 * 添加分类
 */
export function addCategoty(data) {
  return request({
    url: '/categories',
    method: 'post',
    data
  })
}
/**
 * 获取分类详情
 */
export function getCategotyDetail(id) {
  return request({
    url: `/categories/${id}`,
    method: 'get'
  })
}

/**
 * 编辑分类
 */
export function editCategoty(data) {
  return request({
    url: `/categories/${data.id}`,
    method: 'put',
    data
  })
}
/**
 * 获取分类数量
 */
export function getCategotyCount(params) {
  return request({
    url: `/categories/count`,
    params
  })
}
